﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using laba2.Configurations;
using laba2.Entity;

namespace laba2.Context
{
    public class Lab3DBContext: DbContext
    {
        public DbSet<Course> Courses { get; set; }
        public DbSet<Student> Students { get; set; }
        public DbSet<Achivement> Achivements { get; set; }
        public DbSet<PrincipleOfRatingByDate> PrincipleOfRatingByDates { get; set; }
        public DbSet<RatingByDate> RatingByDates { get; set; }
        public DbSet<Evaluation> Evaluations { get; set; } 
        public DbSet<Task> Tasks { get; set; }
        
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AchivementConfiguration());
            modelBuilder.Configurations.Add(new CourseConfiguration());
            modelBuilder.Configurations.Add(new EvaluationConfiguration());
            modelBuilder.Configurations.Add(new PrincipleOfRatingByDateConfiguration());
            modelBuilder.Configurations.Add(new RatingByDateConfiguration());
            modelBuilder.Configurations.Add(new StudentConfiguration());
            modelBuilder.Configurations.Add(new TaskConfiguration());
        }
    }
}
